//入口文件

import Vue from 'vue'
//1.1导入路由包
import VueRouter from 'vue-router'
//导入moment
import moment from 'moment'
//定义全局过滤器
Vue.filter('dataFormat',function(dataStr,patten="YYYY-MM-DD HH:mm:ss"){
 return moment(dataStr).format(patten)
})

//1.2安装路由包
Vue.use(VueRouter)
//1.3导入路由模块
import router from './router.js'
import VueResource from 'vue-resource'
Vue.use(VueResource)
//导入globalConfig.js文件
import config from './js/globalConfig.js'
//设置请求api接口时，默认请求路径
Vue.http.options.root = config.baseUrl;

//按需导入mintui组件
import {Header,Swipe, SwipeItem} from 'mint-ui'
Vue.component(Header.name, Header)
Vue.component(Swipe.name, Swipe)
Vue.component(SwipeItem.name, SwipeItem)
//导入mui的样式
import './lib/mui/css/mui.min.css'
import './lib/mui/css/icons-extra.css'
//导入App模板
import app from './App.vue'
var vm =new Vue({
  el:'#app',
  render:c => c(app),
  //1.4挂载路由模块到vm实例
  router
})